package com.itheima;

import java.util.ArrayList;

public class ClassRoom {
    private String className;
    private String classType;
    private int classCount;

    public ClassRoom() {
    }

    public ClassRoom(String className, String classType, int classCount) {
        this.className = className;
        this.classType = classType;
        this.classCount = classCount;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getClassType() {
        return classType;
    }

    public void setClassType(String classType) {
        this.classType = classType;
    }

    public int getClassCount() {
        return classCount;
    }

    public void setClassCount(int classCount) {
        this.classCount = classCount;
    }
}
class ClassTest{
    public static void main(String[] args) {
        ClassRoom c1= new ClassRoom("123","Java",65);
        ClassRoom c2= new ClassRoom("156","Java",40);
        ArrayList<ClassRoom> list = new ArrayList<>();
        list.add(c1);
        list.add(c2);
        ArrayList<ClassRoom> newList = getClassCount(list);
        for (int i = 0; i < newList.size(); i++) {
           ClassRoom cls =  newList.get(i);
            System.out.println(cls.getClassName()+","+cls.getClassType()+","+cls.getClassCount());
        }
    }
    public static ArrayList<ClassRoom> getClassCount(ArrayList<ClassRoom> users){
        ArrayList<ClassRoom> list = new ArrayList<>();
        for (int i = 0; i <users.size() ; i++) {
            ClassRoom cr = users.get(i);
            if("Java".equals(cr.getClassType())&&cr.getClassCount()>50){
                list.add(cr);
            }
        }
        return list;
    }
}
